package lab02.test36;

public class Undergraduate extends Student {

    public Undergraduate(String name) {
        super(name);
        sort = "本科生";
    }

    @Override
    public void calculateGrade(int grade[]) {

        int total = 0;
        double average = 0;
        for (int i = 0; i < courseNo; i++) {
            total += grade[i];
        }
        average = total / courseNo;
        if (average >= 80) {
            courseGrade = "优秀";
        } else if (average >= 70 && average < 80) {
            courseGrade = "良好";
        } else if (average >= 60 && average < 70) {
            courseGrade = "一般";
        } else if (average >= 50 && average < 60) {
            courseGrade = "及格";
        } else courseGrade = "不及格";
    }
}
